useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.5.0_11'

### Check out ....
	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'Ams_LocDownload_20041228.bin')
		#commonBits.setRecordLayout(select, 'ams Store')
		click('Edit1')
		select('Table', 'rows:[1,2,3,4,5,6,7,8,9],columns:[4|Loc_Name]')
		select_menu('Data>>Table View #{Selected Records#}')
##		select('Table2', 'rows:[1,2,3,4,5,6,7,8,9],columns:[4|Loc_Name]')
		select('Table', 'rows:[2,3,4],columns:[3|Loc_Type]')
		select_menu('Edit>>Cut Record#{s#}')
		select('Table', 'cell:4|Loc_Name,2(Blacktown)')
		rightclick('Table', '4|Loc_Name,2')
		select('Table', 'cell:4|Loc_Name,0(VIC West Ad Support)')
		rightclick('Table', '4|Loc_Name,0')
		select_menu('Edit Record')
##		select('Table1', 'cell:4|Loc_Name,0(VIC West Ad Support)')
		select('Table', 'cell:Data,3(VIC West Ad Support)')
		assert_p('Table', 'Text', 'cell:Data,3(VIC West Ad Support)')
		select('Table', 'cell:Data,5(Lot 2 Little Boundary Rd)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5850, 5850], [Loc_Type, 3, , DC, DC], [Loc_Name, 4, , VIC West Ad Support, VIC West Ad Support], [Loc_Addr_Ln1, 5, , , ], [Loc_Addr_Ln2, 6, , Lot 2 Little Boundary Rd, Lot 2 Little Boundary Rd], [Loc_Addr_Ln3, 7, , Laverton, Laverton], [Loc_Postcode, 8, , 3028, 3028], [Loc_State, 9, , VIC, VIC], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(Lot 2 Little Boundary Rd)')
		click('Right')
		select('Table', 'cell:Data,3(NSW North Sydney Ad Support)')
		assert_p('Table', 'Text', 'cell:Data,3(NSW North Sydney Ad Support)')
		select('Table', 'cell:Data,1(5853)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5853, 5853], [Loc_Type, 3, , DC, DC], [Loc_Name, 4, , NSW North Sydney Ad Support, NSW North Sydney Ad Support], [Loc_Addr_Ln1, 5, , , ], [Loc_Addr_Ln2, 6, , , ], [Loc_Addr_Ln3, 7, , , ], [Loc_Postcode, 8, , , ], [Loc_State, 9, , , ], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,1(5853)')
		click('Right')
		select('Table', 'cell:Data,1(5033)')
		assert_p('Table', 'Text', 'cell:Data,1(5033)')
		select('Table', 'cell:Data,4(Marayong)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5033, 5033], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Blacktown, Blacktown], [Loc_Addr_Ln1, 5, , Marayong, Marayong], [Loc_Addr_Ln2, 6, , Dock 2, 11 Melissa Place, Dock 2, 11 Melissa Place], [Loc_Addr_Ln3, 7, , Marayong, Marayong], [Loc_Postcode, 8, , 2148, 2148], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,4(Marayong)')
		click('Right')
		select('Table', 'cell:Data,4(Building B,  Portside DC)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5035, 5035], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Rockdale, Rockdale], [Loc_Addr_Ln1, 5, , Building B,  Portside DC, Building B,  Portside DC], [Loc_Addr_Ln2, 6, , 2-8 Mc Pherson Street, 2-8 Mc Pherson Street], [Loc_Addr_Ln3, 7, , Botany, Botany], [Loc_Postcode, 8, , 2019, 2019], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,1(5035)')
		assert_p('Table', 'Text', '5035', 'Data,1')
		select('Table', 'cell:Data,1(5035)')
		click('Right')
		select('Table', 'cell:Data,1(5037)')
		assert_p('Table', 'Text', '5037', 'Data,1')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5037, 5037], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Miranda, Miranda], [Loc_Addr_Ln1, 5, , Westfield Shoppingtown, Westfield Shoppingtown], [Loc_Addr_Ln2, 6, , Cnr. Urunga Pde & The Kingsway, Cnr. Urunga Pde & The Kingsway], [Loc_Addr_Ln3, 7, , Miranda, Miranda], [Loc_Postcode, 8, , 2228, 2228], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,2(Blacktown)')
		select('Table', 'cell:4|Loc_Name,2(Blacktown)')
		assert_p('Table', 'RowCount', '6')
		select('Table', 'cell:4|Loc_Name,4(Miranda)')
		select_menu('Edit>>Paste Record#{s#}')
		select('Table', 'cell:4|Loc_Name,4(Miranda)')
		rightclick('Table', '4|Loc_Name,4')
		select_menu('Edit Record')
##		select('Table1', 'cell:4|Loc_Name,4(Miranda)')
		select('Table', 'cell:Data,1(5037)')
		assert_p('Table', 'Text', 'cell:Data,1(5037)')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		assert_p('Table', 'Text', 'cell:Data,4(Westfield Shoppingtown)')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		click('Right')
		  
		select('Table', 'cell:Data,1(5052)')
		assert_p('Table', 'Text', '5866', 'Data,1')
   ### was 5052
		select('Table', 'cell:Data,3(WA Ad Support)')
		select('Table', 'cell:Data,3(WA Ad Support)')
		click('Right')
		select('Table', 'cell:Data,1(5015)')
		assert_p('Table', 'Text', '5015', 'Data,1')
		select('Table', 'cell:Data,3(Bankstown)')
		select('Table', 'cell:Data,3(Bankstown)')
		click('Right')
		select('Table', 'cell:Data,1(5019)')
		assert_p('Table', 'Text', 'cell:Data,1(5019)')
   ### was 5052
		select('Table', 'cell:Data,4(Penrith)')
		select('Table', 'cell:Data,4(Penrith)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,5(WA Ad Support)')
		select('Table', 'cell:4|Loc_Name,5(WA Ad Support)')
		assert_p('Table', 'RowCount', '9')
   ### was 6
		select('Table', 'cell:4|Loc_Name,6(Bankstown)')
		select('Table', 'rows:[2,3,4],columns:[4|Loc_Name]')
		select_menu('Edit>>Delete Record#{s#}')
		select('Table', 'cell:4|Loc_Name,1(NSW North Sydney Ad Support)')
		assert_p('Table', 'RowCount', '6')
		select('Table', 'cell:4|Loc_Name,1(NSW North Sydney Ad Support)')
		rightclick('Table', '4|Loc_Name,1')
		select_menu('Edit Record')
##		select('Table1', 'cell:4|Loc_Name,1(NSW North Sydney Ad Support)')
		select('Table', 'cell:Data,1(5853)')
		assert_p('Table', 'Text', '5853', 'Data,1')
		select('Table', 'cell:Data,1(5853)')
		click('Right')
		select('Table', 'cell:Data,1(5866)')
		assert_p('Table', 'Text', '5866', 'Data,1')
 ### 5033
		select('Table', 'cell:Data,1(5866)')
		click('Right')
		select('Table', 'cell:Data,1(5015)')
		assert_p('Table', 'Text', '5015', 'Data,1')
		select('Table', 'cell:Data,5(Unit 2, 39-41 Allingham Street)')
		select('Table', 'cell:Data,5(Unit 2, 39-41 Allingham Street)')
		click('Right')
		select('Table', 'cell:Data,1(5019)')
		assert_p('Table', 'Text', '5019', 'Data,1')
		select('Table', 'cell:Data,4(Penrith)')
		select('Table', 'cell:Data,4(Penrith)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,2(WA Ad Support)')
		select('Table', 'cell:4|Loc_Name,2(WA Ad Support)')
		assert_p('Table', 'RowCount', '6')
		select('Table', 'cell:4|Loc_Name,3(Bankstown)')
		select('Table', 'cell:4|Loc_Name,1(NSW North Sydney Ad Support)')
		select_menu('Edit>>Copy Record#{s#}')
		select('Table', 'cell:3|Loc_Type,3(ST)')
		select_menu('Edit>>Paste Record#{s#} Prior')
		select('Table', 'cell:2|Loc_Nbr,2(5866)')
		rightclick('Table', '2|Loc_Nbr,2')
		select_menu('Edit Record')
##		select('Table1', 'cell:2|Loc_Nbr,2(5866)')
		select('Table', 'cell:Data,1(5866)')
		assert_p('Table', 'Text', 'DC', 'Data,2')
  ### was ST
		select('Table', 'cell:Data,1(5866)')
		click('Right')
		select('Table', 'cell:Data,1(5853)')
		assert_p('Table', 'Text', '5853', 'Data,1')
 ### was 5035
		select('Table', 'cell:Data,1(5853)')
		click('Right')
		select('Table', 'cell:Data,1(5015)')
		assert_p('Table', 'Text', 'cell:Data,1(5015)')
  ### was 5037
		select('Table', 'cell:Data,3(Bankstown)')
		select('Table', 'cell:Data,3(Bankstown)')
		click('Right')
		select('Table', 'cell:Data,1(5019)')
		assert_p('Table', 'Text', 'cell:Data,1(5019)')
 ### was 5019 ???
		select('Table', 'cell:Data,1(5019)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,5(Penrith)')
		select('Table', 'cell:4|Loc_Name,5(Penrith)')
		select_menu('Edit>>Paste Record#{s#}')
		select('Table', 'cell:4|Loc_Name,5(Penrith)')
		rightclick('Table', '4|Loc_Name,5')
		select_menu('Edit Record')
##		select('Table1', 'cell:4|Loc_Name,5(Penrith)')
		select('Table', 'cell:Data,1(5052)')
		assert_p('Table', 'Text', '5019', 'Data,1')
 ### was 5052
		select('Table', 'cell:Data,1(5019)')
		click('Right')
		select('Table', 'cell:Data,1(5052)')
		assert_p('Table', 'Text', '5853', 'Data,1')
 ### was 5052
		select('Table', 'cell:Data,2(DC)')
		select('Table', 'cell:Data,2(DC)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,1(NSW North Sydney Ad Support)')
		select('Table', 'rows:[1,2,3,4,5],columns:[4|Loc_Name]')
		select_menu('Edit>>Delete Record#{s#}')
		select('Table', 'cell:4|Loc_Name,1(NSW North Sydney Ad Support)')
		assert_p('Table', 'RowCount', '3')
  ### was 6
		select('Table', 'cell:4|Loc_Name,0(VIC West Ad Support)')
		select('Table', 'cell:4|Loc_Name,0(VIC West Ad Support)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		#click('WindowsInternalFrameTitlePane', 856, 12)
		click('BasicInternalFrameTitlePane$NoFocusButton2')

		if window('Save Changes to file: ' + commonBits.sampleDir() + 'Ams_LocDownload_20041228.bin'):
			click('No')
		close()
	close()
